// Layout组件
// import Layout from '@/Layout/index.vue';
import { RouteRecordRawConfig } from './type.ts';

// 常量路由
export const constantRoutes: RouteRecordRawConfig[] = [
  {
    path: '/login',
    name: 'Login',
    component: () => import('@/views/Login/index.vue'),
    meta: { hidden: true }
  },
  {
    path: '/404',
    component: () => import('@/views/404.vue'),
    meta: { hidden: true }
  },
  {
    path: '/',
    name: 'Layout',
    component: () => import('@/Layout/index.vue'),
    redirect: '/home',
    meta: { title: '', icon: '' },
    children: [
      {
        path: 'home',
        name: 'Home',
        meta: { title: '首页', icon: 'home' },
        component: () => import('@/views/Home/index.vue')
      }
    ]
  },
  {
    path: '/screen',
    name: 'Screen',
    meta: { title: '数据大屏', icon: 'airplay' },
    component: () => import('@/views/Screen/index.vue')
  }
];

// 异步路由
export const asyncRoutes: RouteRecordRawConfig[] = [
  {
    path: '/acl',
    name: 'Acl',
    meta: { title: '权限管理', icon: 'lock_open' },
    // component: Layout,
    component: () => import('@/Layout/index.vue'),
    children: [
      {
        path: 'user',
        name: 'User',
        meta: { title: '用户管理', icon: 'person_outline' },
        component: () => import('@/views/Acl/User/index.vue')
      },
      {
        path: 'role',
        name: 'Role',
        meta: { title: '角色管理', icon: 'person' },
        component: () => import('@/views/Acl/Role/index.vue')
      },
      {
        path: 'permission',
        name: 'Permission',
        meta: { title: '菜单管理', icon: 'view_list' },
        component: () => import('@/views/Acl/Permission/index.vue')
      }
    ]
  },
  {
    path: '/product',
    name: 'Product',
    meta: { title: '商品管理', icon: 'work_outline' },
    // component: Layout,
    component: () => import('@/Layout/index.vue'),
    children: [
      {
        path: 'trademark',
        name: 'Trademark',
        meta: { title: '品牌管理', icon: 'shoping_cart' },
        component: () => import('@/views/Product/Trademark/index.vue')
      },
      {
        path: 'attr',
        name: 'Attr',
        meta: { title: '平台属性管理', icon: 'attribution' },
        component: () => import('@/views/Product/Attr/index.vue')
      },
      {
        path: 'spu',
        name: 'Spu',
        meta: { title: 'SPU管理', icon: 'view_module' },
        component: () => import('@/views/Product/Spu/index.vue')
      },
      {
        path: 'sku',
        name: 'Sku',
        meta: { title: 'SKU管理', icon: 'view_comfy' },
        component: () => import('@/views/Product/Sku/index.vue')
      }
    ]
  }
];

// 任意路由
export const anyRoutes: RouteRecordRawConfig[] = [
  {
    path: '/:pathMatch(.*)*',
    name: 'NotFound',
    redirect: '/404',
    meta: { hidden: true }
  }
];
